<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增抽奖用户')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-role-add">
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">姓名：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="psnName" id="psnName" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">手机号：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="tel" id="tel" required>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		function submitHandler() {
	        if ($.validate.form()) {
	        	add();
	        }
	    }
	
		function add() {
			var psnName = $("input[name='psnName']").val();
			var tel = $("input[name='tel']").val();
			$.ajax({
				cache : true,
				type : "POST",
				url : ctx + "biz/lotteryUser/add",
				data : {
					"psnName": psnName,
					"tel": tel
				},
				async : false,
				error : function(request) {
					$.modal.alertError("系统错误");
				},
				success : function(data) {
					$.operate.successCallback(data);
				}
			});
		}
	</script>
</body>
</html>
